﻿ 
@using Ema.Models.XtModel

@model AmazeUI.db.Article
@{
    ViewBag.Title = Model.Titel;
    Layout = "~/Views/Shared/SimLay.cshtml";
    var uid = ViewBag.uid ?? 0;
}

<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav"> 
        <a href="@Url.Action("Index")" class="">
            <span class="am-header-nav-title">返回</span>
            <i class="am-header-icon am-icon-home"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">@ViewBag.Title</a>
    </h1>
    <div class="am-header-right am-header-nav">

    </div>
</header>
<div class="am-g">
    <div class="am-u-sm-12">
        <article class="am-article">
            <div class="am-article-hd">

                <p class="am-article-meta">
                    作者： @Model.XtUser.Name
                    时间：@Model.UpTime
                </p>
            </div>
            <div class="am-article-bd">
                @MvcHtmlString.Create(Model.Comment)
            </div>
        </article>
    </div>
</div>

 
       
        
            <div class="am-g">
                <div class="am-u-sm-12">
                    @foreach (var item in Model.ArticleComment)
                    {
                        <ul class="am-comments-list am-comments-list-flip )">
                            <li class="am-comment @(item.XtUserId == uid ? "am-comment-flip" : "")">
                                <a href="#">
                                    <img src="@item.XtUser.ImgUrl" alt="" class="am-comment-avatar" width="64" height="64" />
                                </a>

                                <div class="am-comment-main">
                                    <header class="am-comment-hd">
                                        <!--<h3 class="am-comment-title">评论标题</h3>-->
                                        <div class="am-comment-meta">
                                            <a href="#" class="am-comment-author">@item.XtUser.Name</a>
                                            评论于 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">@item.UpTime.ToString()</time>
                                        </div>
                                    </header>

                                    <div class="am-comment-bd">
                                        @item.Comment
                                    </div>
                                </div>
                            </li>
                        </ul>
                    }
                </div>
            </div>

            <div class="am-g">
                <div class="am-u-sm-12">

                    @using (Html.BeginForm("Comment", "Article", new { @class = "am-form am-form-horizontal" }, FormMethod.Post))
                    {
                        var model = new SubArticleComment();


                        @Html.Hidden("ArticleId", Model.Id)
                        <label>评论</label>
                        <div class="am-form-group">
                            <div class="am-input-group">
                                @Html.TextBoxFor(a => model.Comment, new { @class = "am-form-field", placeholder = "输入评论" })
                                <span class="am-input-group-btn">
                                    <button class="am-btn am-btn-success" type="submit">提交</button>
                                </span>
                            </div>
                        </div>
                    }
                </div>
            </div>

 